<template>
  <div>
    <!-- 顶部 -->
    <HomePannel ref="target" title="人气推荐" subTitle="人气爆款 不容错过">
      <!-- 更多好物品 -->
      <template #right>
        <XtxMore path="/"></XtxMore>
      </template>
      <!-- 公共模块 -->
      <template #default>
        <HomeCitizen :list="newData" bg="#fff" />
      </template>
    </HomePannel>
  </div>
</template>

<script>
import HomePannel from '../components/home-panel.vue'
import { findHot } from '@/api/home'
import { ref } from 'vue'
import { useObserbe } from '@/hook/index.js'
// 模块抽离
import HomeCitizen from './home-citizen.vue'
export default {
  components: {
    HomePannel,
    HomeCitizen
  },
  setup () {
    const newData = ref([])
    async function getNew () {
      const { data } = await findHot()
      newData.value = data.result
    }
    const { target } = useObserbe(getNew)

    return { newData, target }
  }
}
</script>

<style scoped lang='less'>
</style>
